﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../js/jquery.js"></script>
    <script src="../js/mootools.js"></script>
    <script src="../js/base.js"></script>
    <script type="text/javascript">
        var WindowParameter = {Width:"300px",Height:"200px"};

        a.Width = "500px";
        var Window = new Class({
            initialize: function (ctl, btns)
            {
                var me = this;
                //创建事件
                for (var i = 0; i < btns.length; i++)
                {
                    xbtn = btns[i];
                    for (attr in xbtn)
                    {
                        if (typeof xbtn[attr] === 'function')
                        {
                            var fun = xbtn[attr];
                            xbtn[attr] = function (evt)
                            {
                                fun.call(me, this, evt);
                            }
                        }
                    }
                    xbtn["type"] = "button";
                    xbtn["val"] = xbtn.Value;
                    $(ctl).append($("<input>", xbtn));
                }
            }
        });
        $(function ()
        {

            new Window("#alert", [
                { Value: "确定", click: function (sender, e) { debugger; } },
                { Value: "取消", click: function (sender, e) { debugger; } }]);
        });

    </script>
</head>
<body>
    <div id="alert"></div>
</body>
</html>
